package work20241203_chap6oop.m_demo10;

/**
 * @author zdl
 * @date 2024/12/5
 */
public class Demo {
    public static void main(String[] args) {
        Bank bank = new Bank();
        Account account = bank.openAccount(1111, "123456", 1);
        if (account instanceof SavingAccount){
            SavingAccount savingAccount = (SavingAccount) account;
            System.out.println(savingAccount.getId());
            System.out.println(savingAccount.getBalance());
            System.out.println(savingAccount.getPassword());
            System.out.println(savingAccount.getInterestRate());
        }
        bank.deposit(account,3000);
        double deposit = bank.deposit(account, 200);
        System.out.println("余额:"+deposit);
        double withdraw = bank.withdraw(account, 2000);
        System.out.println("取款后余额:"+withdraw);
    }
}
